#ifndef _SQLACCESS_H_
#define _SQLACCESS_H_
#include <mysql.h>
#include <time.h>
#include "GpsDataStruct.h"
#include "Logging.h"

//extern int errorNum;                  //错误代号
//extern const char* errorInfo;         //错误提示

int insertInto(MYSQL *mysql, const char* tbName, const char* colName, const char* content);       //向表中添加数据
int insertGpsDataStruct(MYSQL *mysql, GpsDataStruct* gds);                                        //向表中添加GpsDataStruct类型数据
int insert2Clienttable(MYSQL* mysql, const char* cName);                                          //向clienttable插入数据
int GetIdWithClientName(MYSQL* mysql, const char* clientname );                                   //使用客户端名获取对应id，如表中不存在则插入该客户端
int insertGpsDataGroup(MYSQL* mysql, GpsDataStruct** gdsArray, int lens);                         //将gpsdata队列数据拼接处理后存入表中
void errorIntoMySQL(MYSQL *mysql);								  //获取错误信息


#endif